<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对属性的操作</title>
    <script type="text/javascript"src="../js/jquery-3.3.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //设置图片的宽和高
            $("img").attr({width:"600px",height:"400px"});
            //获取图片的宽
            alert("width:"+$("img").attr("width"));
            //删除图片的宽度
            $("img").removeAttr("width");
            alert("删除 width 之后："+$("img").attr("width"))
        })
    </script>

</head>
<body>
      <img src="../imgs/01.jpg"/>
</body>
</html>